<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div class="wrap">
        <div class="nav-btn"></div>
        <div class="con"></div>
    </div>
    <script>
        class Tab{
            constructor(options){
                this.el = this.getDom(options.el);
                this.navBtns = this.getDom('.nav-btn',this.el);
                this.con = this.get('.con',this.el);
                this.data = options.data;
                this.create();
            }

            create(){
                Object.keys(this.data).forEach(item => {
                    let navBtn = this.createElement('button',{
                        style:{
                            width:'80px',
                            height:'40px',
                            background:'blue'
                        },
                        class:'btn'
                    },item)
                })
            }

            createElement(){

            }

            getDom(target,parent=document){
                return typeof target === 'string' ? parent.querySelector(target) : target;
            }
        }

        new Tab({
            el:'.wrap',
            data:{
                btn1:[
                    {text:'今日头条1'},
                    {text:'今日头条1'}
                ],
                btn2:[
                    {text:'今日头条2'},
                    {text:'今日头条2'}
                ],
                btn3:[
                    {text:'今日头条3'},
                    {text:'今日头条3'}
                ]
            }
        })
    </script>
</body>
</html>